#include <iostream>
#include <vector>
#include <string>
using namespace std; 

string longestCommonPrefix(vector<string>& strs) {
    string s;
    if( strs.size()>0 )
	    for(int i=0; i<strs[0].length(); i++){
	    	bool flag = 0;
	    	for(int j=1; j<strs.size(); j++){
	    		if( strs[j][i]!=strs[0][i] ){
	    			flag = 1;
	    			break;
				}
			}
			if( flag==0 ) s.push_back(strs[0][i]);
			else break;
		}
	return s;
}
int main(){
	vector<string> strs = {};
	cout << longestCommonPrefix(strs);
	return 0;
}
